#define DEBUG 0
#if DEBUG
-
#define DPRINTK(fmt, args...) \
printk(KERN_INFO "[XEN] %s" fmt, __FUNCTION__, ##args)
-
#else
-
#define DPRINTK(fmt, args...) ((void)0)
-
#endif
#define IPRINTK(fmt, args...) \
#define EPRINTK(fmt, args...) \
printk(KERN_ERROR "[XEN]" fmt, ##args)
-
-
#ifndef __GFP_NOWARN
#define __GFP_NOWARN 0
#endif
} while ( 0 )
/* Allow headroom on each rx pkt for Ethernet header, alignment padding, ... */
-#define RX_HEADROOM 100
+#define RX_HEADROOM 200
/*
* If the backend driver is pipelining transmit requests then we can be very
spin_unlock_irq(&np->tx_lock);
}
-static void vif_show(struct net_private *np){
+static void vif_show(struct net_private *np)
+{
#if DEBUG
- if(np){
+ if (np) {
IPRINTK(" <vif handle=%u %s(%s) evtchn=%u irq=%u tx=%p rx=%p>\n",
np->handle,
be_state_name[np->backend_state],
#endif
}
-/* Send a connect message to xend to tell it to bring up the interface.
- */
-static void send_interface_connect(struct net_private *np){
+/* Send a connect message to xend to tell it to bring up the interface. */
+static void send_interface_connect(struct net_private *np)
+{
ctrl_msg_t cmsg = {
.type = CMSG_NETIF_FE,
.subtype = CMSG_NETIF_FE_INTERFACE_CONNECT,
switch (status->status) {
case NETIF_INTERFACE_STATUS_CLOSED:
- switch(np->backend_state){
-
+ switch ( np->backend_state )
+ {
case BEST_CLOSED:
case BEST_DISCONNECTED:
case BEST_CONNECTED:
break;
case NETIF_INTERFACE_STATUS_DISCONNECTED:
- switch(np->backend_state){
-
+ switch ( np->backend_state )
+ {
case BEST_CLOSED:
vif_disconnect(np);
break;
-
case BEST_DISCONNECTED:
case BEST_CONNECTED:
vif_reset(np);
break;
case NETIF_INTERFACE_STATUS_CONNECTED:
- switch(np->backend_state){
-
+ switch ( np->backend_state )
+ {
case BEST_CLOSED:
unexpected(np, status);
vif_disconnect(np);
vif_connect(np, status);
break;
-
case BEST_DISCONNECTED:
vif_connect(np, status);
break;
-
- case BEST_CONNECTED:
- //todo Do what?
- unexpected(np, status);
- break;
}
break;
case NETIF_INTERFACE_STATUS_CHANGED:
- /* The domain controller is notifying us that a device has been
- * added or removed.
- */
+ /*
+ * The domain controller is notifying us that a device has been
+ * added or removed.
+ */
break;
default: